@echo off
setlocal enabledelayedexpansion
for /l %%i in (1,1,5) do (
    set var=%%i
    echo !var!
)